<!--
 * @Author: xiaxia
 * @Description: 
 * @Date: 2024-06-19 11:20:52
 * @LastEditTime: 2024-07-17 16:11:36
 * @FilePath: \project\src\components\SvgIcon\index.vue
-->
<!--
 * @Author: xiaxia
 * @Description: 
 * @Date: 2024-06-19 11:20:52
 * @LastEditTime: 2024-06-19 11:21:01
 * @FilePath: \project\src\components\SvgIcon.vue
-->
<template>
  <div>
    <svg :style="{ width, height }">
      <!-- xlink: herf执行用哪一个图标 , 属性务必是# icon-图标名字 -->
      <use :xlink:href="prefix + name" :fill="color"></use>
    </svg>
  </div>
</template>

<script setup lang="ts">
defineProps({
  //xlink:href属性值的前缀
  prefix: {
    type: String,
    default: '#icon-'
  },
  //svg矢量图的名字
  name: String,
  //svg图标的颜色
  color: {
    type: String,
    default: ""
  },
  //svg宽度
  width: {
    type: String,
    default: '16px'
  },
  //svg高度
  height: {
    type: String,
    default: '16px'
  }

})
</script>
<style scoped></style>